//
//  WDWorderOrderWaitVehicleBottomView.m
//  wd-serviceapp
//
//  Created by Bin Tang on 2024/8/5.
//

#import "WDWorderOrderWaitVehicleBottomView.h"

@interface WDWorderOrderWaitVehicleBottomView ()

/// 扫码接车
@property (nonatomic ,strong) UIButton *btnScanCode;
@end

@implementation WDWorderOrderWaitVehicleBottomView

- (void)initWithVar {
    [super initWithVar];
    
}

- (void)initWithSubView {
    [super initWithSubView];
    
    self.backgroundColor = [UIColor whiteColor];
    
    [self initWithBtnScanCode];
}

- (void)initWithBtnScanCode {
    if (!_btnScanCode) {
        CGRect frame = CGRectMake(20, 2, self.width - 40, 40);
        _btnScanCode = [UIButton createWithButton:self frame:frame font:[UIFont systemFontOfSize:14 weight:UIFontWeightRegular] target:self action:@selector(actionWithScanCode:) propertiesBlock:^(UIButton * _Nonnull button) {
            button.backgroundColor = kThemeColor;
            [button setTitle:@"扫码接车" forState:UIControlStateNormal];
            [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
            button.layer.cornerRadius = 5;
            button.layer.masksToBounds = YES;
        }];;
    }
}

/// 点击按钮，扫码接车
/// - Parameter sender: sender description
- (void)actionWithScanCode:(id)sender {
    if (self.touchScanCodeBlock) {
        self.touchScanCodeBlock();
    }
}

- (void)setBtnTitle:(NSString *)btnTitle {
    [self.btnScanCode setTitle:btnTitle forState:UIControlStateNormal];
}

@end
